This patch adds the argument check of "--ms_per_sample=" option. For
authorEwan Mellor <ewan@xensource.com>
Tue, 5 Sep 2006 16:06:02 +0000 (17:06 +0100)
committerEwan Mellor <ewan@xensource.com>
Tue, 5 Sep 2006 16:06:02 +0000 (17:06 +0100)
"--ms_per_sample=", a negative value should be invalid.

e.g.
% xenmon.py -n --ms_per_sample=-1
usage: xenmon.py [options]

xenmon.py: error: option --ms_per_sample: invalid negative value: '-1'

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
tools/xenmon/xenmon.py

index 1b74d19403784888e32ee0e952e80dc1f793dc4b..402b6b4e1860f4bb3d8086e0432b0b49b764c2de 100644 (file)
@@ -672,6 +672,9 @@ def main():
 
     parser = setup_cmdline_parser()
     (options, args) = parser.parse_args()
+    if options.mspersample < 0:
+        parser.error("option --ms_per_sample: invalid negative value: '%d'" %
+                     options.mspersample)
     
     start_xenbaked()
     if options.live: